<!DOCTYPE html>
<html lang="en">
<head>
<title>系统修改密码界面</title> 
#@common()
<style type="text/css">
body { padding: 10px; background: #fff; }
.layui-form-label { min-width: 100px; }
body * {color: #393939 !important;}
</style>
</head>
<body>
	<form class="layui-form layui-fluid" action="">
		<div class="layui-row">
			<div class="layui-form-item">
				<div class="layui-col-md6 layui-col-xs6 layui-col-sm6 layui-form-label">原密码</div>
				<div class="layui-col-md6 layui-col-xs6 layui-col-sm6">
					<input autocomplete="off" type="password" name="oPwd" 
						required lay-verify="required" placeholder="请输入原密码" class="layui-input">
				</div>
			</div>
			
			<div class="layui-form-item">
				<div class="layui-col-md6 layui-col-xs6 layui-col-sm6 layui-form-label">新密码</div>
				<div class="layui-col-md6 layui-col-xs6 layui-col-sm6">
					<input autocomplete="off" type="password" name="nPwd" 
						required lay-verify="required" placeholder="请输入新密码" class="layui-input">
				</div>
			</div>
			
			<div class="layui-form-item">
				<div class="layui-col-md6 layui-col-xs6 layui-col-sm6 layui-form-label">重新输入</div>
				<div class="layui-col-md6 layui-col-xs6 layui-col-sm6">
					<input autocomplete="off" type="password" name="cPwd" 
						required lay-verify="required" placeholder="请重新输入密码" class="layui-input">
				</div>
			</div>
	  		
	  		<div class="layui-form-item" style="margin-top: 40px;">
				<div class="layui-col-md8 layui-col-xs8 layui-col-sm8 layui-col-md-offset3 layui-col-xs-offset3 layui-col-sm-offset3">
					<button class="layui-btn layui-bg-blue" lay-submit lay-filter="form">确认修改</button>
					<button type="button" class="layui-btn layui-btn-primary" onclick="closeLayer()">关闭返回</button>
				</div>
			</div>
		</div>
	</form>

	<script>
		//layui的相关数据加载
		layui.use('form', function() {
			var form = layui.form;
			//监听提交
			form.on('submit(form)', function(data) {
				Http.post('admin/updatePwd', data.field, function(res){
					if(res.succeed){
						//closeLayer();
						parent.layer.alert('修改成功,请退出重新登陆',{
								icon: 1, skin: 'layer-ext-moon', closeBtn: 0, title :'系统提示'
							}, function(){
							parent.loginOut();
						});
					} else {
						parent.layer.msg(res.message)
					}
				})
				return false;
			});
		});
		
		/** 关闭系统菜单录入页面 */
		function closeLayer(){
			closeParentLayer();
		}
		
	</script>
</body>
</html>